import dao.lzl.dao.NewsDao;
import dao.lzl.factory.AbstractFactory;
import dao.lzl.factory.MySqlDaoFactory;
import dao.lzl.pojo.News;
import dao.lzl.service.impl.NewsServiceImpl;
import org.junit.Test;

public class NewsServiceImplText {
    @Test
    public void addNews() throws Exception{
        AbstractFactory factory = new MySqlDaoFactory();
        NewsDao dao = factory.getInstance();
        NewsServiceImpl service = new NewsServiceImpl();
        service.setDao(dao);

        News news = new News();
        news.setNtitle("测试标题4");
        news.setNcontent("测试内容4");
        service.addNews(news);
    }
}
